<template>
  <tr>
    <td>{{index+1}}</td>
    <td>{{category.name}}</td>
    <td>{{category.showindex=='y'?'是':'否'}}</td>
    <td>
      <div class="button-group">
        <a class="button border-main"
           href="javascript:void(0)" @click="edit(category.id)">
          <span class=" icon-edit"></span> 修改</a>
        <a class="button border-red" href="javascript:void(0)" @click="$emit('doDel')"><span
          class="icon-trash-o"></span> 删除</a>
      </div>
    </td>
  </tr>

</template>

<script>
  import CategoryPage from "./CategoryPage";

  export default {
    components: {CategoryPage},
    props: {
      category: Object,
      index: Number
    },
    name: "CategoryItem",
    methods: {
      edit(id) {
        alert("修改：" + id)
      },
    }
  }
</script>

<style scoped>

</style>
